package com.shop.cart.dao;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;

import com.shop.cart.vo.CartVO;
import com.shop.framework.util.Logger;

@Repository
public class CartDAOImpl extends SqlSessionDaoSupport implements CartDAO {

	
	@Override
	public int isUserCnt(CartVO.CartItem cartItem) {
		// 회원 등록 여부 판단
		int isUserCnt = (Integer)getSqlSession().selectOne("com.shop.member.isUserCnt", cartItem);

		return isUserCnt;
	}
	
	@Override
	public int addMember(CartVO.CartItem cartItem) {
		// TODO Auto-generated method stub
		
		
		int cnt = 0;

		cnt = (Integer)getSqlSession().insert("com.shop.member.addMember", cartItem);
		
		Logger.getLogger().debug(this.getClass().getName() + " : " + this.getClass().getMethods()[0].getName());
		return cnt;
	}

}
